package com.weishenai.customerassistant.service.impl;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.weishenai.customerassistant.entity.sys.SysUserRoleEntity;
import com.weishenai.customerassistant.mapper.SysUserRoleMapper;
import com.weishenai.customerassistant.service.SysUserRoleService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author weishenai
 * @since 2021-11-27
 */
@Service
public class SysUserRoleServiceImpl extends ServiceImpl<SysUserRoleMapper, SysUserRoleEntity> implements SysUserRoleService {

    @Override
    public List<SysUserRoleEntity> getRolesByUserId(Long userId) {
        return this.list(Wrappers.lambdaQuery(SysUserRoleEntity.class).eq(SysUserRoleEntity::getUserId,userId));
    }
}
